package modele;

/**
 * Interface for the cells of the goose game. Note that there can be only player
 * by cell, the starting cell (index 0) excepted.
 */
public interface Cell {

	/**
	 * Indicates if a player occupying this cell can, at this turn, leave the
	 * cell.
	 * 
	 * @return true if and only if the player in this cell can freely leaves the
	 *         cell at this turn.
	 */
	public boolean canBeLeftNow();

	/**
	 * Indicates the position in the board of this cell.
	 * 
	 * @return a number greater than or equal to 0 (for the starting cell only).
	 */
	public int getIndex();

	/**
	 * Returns the index of the cell really reached by a player when he reaches
	 * this cell. For normal cells, the returned values equals
	 * <code>getIndex()</code> and is thus independent from
	 * <code>diceThrow</code>.
	 * 
	 * @param diceThrow
	 *            the result of the dice when the player reaches this cell
	 * @return the index of the cell effectively reached when a player reaches
	 *         this cell after the given throw of dice.
	 */
	public int handleMove(int diceThrow);

	/**
	 * Indicates if a player currently occupies this cell.
	 * 
	 * @return true if and only if a player is in this cell.
	 */
	public boolean isBusy();

	/**
	 * Returns the player currently occupying this cell, <code>null</code> if
	 * none.
	 * 
	 * @return the player currently in this cell, <code>null</code> if none.
	 */
	public Player getPlayer();

	/**
	 * Insert a player inside a Cell.
	 * 
	 * @param player
	 *            to put in the cell, <code>null</code> to empty.
	 */
	public void setPlayer(Player player);

	/**
	 * Indicates the type of the cell.
	 * 
	 * @return type of cell
	 */
	public String getTypeCell();
	
	/**
	 * When the cell send a player on another cell, it announces it before.
	 * @param diceThrow needed by GooseCell.
	 */
	public void welcome(int diceThrow);

}
